beta = 10;
mu = -8;

Num = 4000;

np = (-Num/2+1):(Num/2);

vomega = 2*pi/beta*np;

vr = (exp(1j*beta/Num*vomega) - 1)/1j/beta*Num +1j*exp(1j*beta/Num*vomega)*mu;

close(figure(1));
figure(1);
plot(vr,'r*');


fprintf('\n fmdlf \n');

fprintf(' test anti unitary \n');

N = 10;

L = 4;

vx = (0:(N-1))*L/N;
vk = ((0:(N-1)) + 1/2)*2*pi/L;

mx = ones(N, 1)*vx;
mk = transpose(vk)*ones(1, N);
U = 1/sqrt(N)*exp(1j*mx.*mk);

M = diag(ones(1, N-1), -1);
M(1, N) = -1;

M2 = U*M*U';
M3 = diag(exp(1j*2*pi/N*((0:(N-1))+1/2)));

fprintf(' Uintary test: %e \n', norm(U*U' - eye(N)));
fprintf(' Test diagonalization : %e \n', norm(M2 - M3));

